/**
 * 
 */

$(function(){
	var _url = "service.do?s=login";
	$.post(_url,{op:"CheckLogin"},function(data){
		var event = eval("(" + data + ")");
		if(event.returnCode == "success"){
			$("#userName").html(event.result.userName);
		} else {
			window.location.href = "index.jsp";
		}
	},"html");
	
	$("#logout").click(function(){
		$.post(_url,{op:"logout"},function(data){
			var event = eval("(" + data + ")");
			if(event.returnCode == "success") {
				window.location.href = "index.jsp";
			}
		},"html");
	});
});